#ifndef LINK_LIST_H
#define LINK_LIST_H

#include "../c1.h"
#include "List.h"


class LinkList: public List {

public:
    LinkList() {}
    ~LinkList() {}

public:
    virtual Status InitList(void) override;
    virtual Status DestoryList(void)override;
    virtual Status ClearList(void)override;
    virtual Status ListEmpty(void)override;
    virtual int ListLength(void)override;
    virtual Status GetElem(int i, ElemType *e)override;
    virtual int LocateElem(ElemType e, Status(*compare)(ElemType, ElemType))override;
    virtual Status PriorElem(ElemType cur, ElemType *prev)override;
    virtual Status NextElem(ElemType cur, ElemType *next)override;
    virtual Status ListInsert(int i, ElemType e)override;
    virtual Status ListDelete(int i, ElemType *e)override;
    virtual Status ListTraverse(void) override;
    virtual Status ListHeadInsert(ElemType e);
    virtual Status ListTailInsert(ElemType e);
private:
    struct LinkNode {
        ElemType e;
        LinkNode *next;
    };
    LinkNode *LinkListHead;
};

#endif